﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace spriteData
{
    class XFrameInAnimation
    {
        private int frameId;
        private int x;
        private int y;
        private int delay;   
        public int X
        {
            get { return this.x; }
            set { this.x = value; }
        }
        public int Y
        {
            get { return this.y; }
            set { this.y = value; }
        }
        public int FrameId
        {
            get { return this.frameId; }
            set { this.frameId = value; }
        }
        public int Delay
        {
            get { return this.delay; }
            set { this.delay = value; }
        }
        public void serial(BinaryWriter bw)
        {
            bw.Write(frameId);
            bw.Write(delay);
            bw.Write(x);
            bw.Write(y);
        }
        
    }
    class XAnimation
    {
        public XAnimation()
        {
            frames = new List<XFrameInAnimation>();
        }
        public List<XFrameInAnimation> frames;
        private int id;      
      
        public int Id
        {
            get { return this.id; }
            set { this.id = value; }
        }
        public void serial(BinaryWriter bw)
        {
            bw.Write(id);
            bw.Write(frames.Count);
            foreach(XFrameInAnimation fia in frames)
            {
                fia.serial(bw);
            }
        }
       
    
    }
}
